<template>
	<view class="container">
		<view class="content" v-for="(item,key) in sportInfo" :key="key">
			<view class="border"></view>
			<view class="main" @click="isOpend(item.id,item.name)">
				<view @click="isOpend(item.id)">
					<view style="font-size: 40rpx;font-weight: bold;">{{item.name}}</view>
					<view style="color: #808080;">{{item.en}}</view>
				</view>
				<view class="image">
					<image style="width: 60rpx;" :src="item.img" mode="widthFix"></image>
				</view>
				<view style="margin-right: 20rpx;">
					<u-icon name="arrow-right" size="18" color="grey"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sportInfo:[
					{
						id:1,
						name:'篮球',
						en:"Basketball",
						img: require("@/static/sport-icon/baskball.png")
					},
					{
						id:2,
						name:'足球',
						en:"Football",
						img: require("@/static/sport-icon/football.png")
					},
					{
						id:3,
						name:'乒乓球',
						en:"PingPangBall",
						img: require("@/static/sport-icon/ping_pong.png")
					},
					{
						id:4,
						name:'排球',
						en:"Volleyball",
						img: require("@/static/sport-icon/volleyball.png")
					},{
						id:5,
						name:'羽毛球',
						en:"Badminton",
						img: require("@/static/sport-icon/badminton.png")
					},{
						id:8,
						name:'网球',
						en:"Tennis",
						img: require("@/static/sport-icon/tennis.png")
					},{
						id:6,
						name:'桌球',
						en:"Snooker",
						img: require("@/static/sport-icon/snooker.png")
					},{
						id:7,
						name:'电竞',
						en:"",
						img: require("@/static/sport-icon/game.png")
					},
				]
			}
		},
		methods: {
			isOpend(id,name){
				console.info(id)
				if(id > 4){
					uni.showToast({
					    title: '暂未开放，尽情期待。。。',
						icon: "none"
					});
				}else{
					uni.navigateTo({
						url:"./time?name="+name
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		height: 100%;
	}
	.container{
		background-color: #EBEDF0;
		.content {
			display: flex;
			flex-direction: row;
			justify-content: flex-start;
			justify-items: center;
			align-items: center;
			padding: 20rpx;
			.border{
				height: 150rpx;
				border: 10rpx solid #2979ff;
				border-bottom-left-radius: 20rpx;
				border-top-left-radius: 20rpx;
			}
			.main{
				background-color: white;
				height: 170rpx;
				display: flex;
				justify-content: space-between;
				justify-items: center;
				align-items: center;
				width: 94%;
				position: relative;
				padding-left: 20rpx;
				border-top-right-radius: 20rpx;
				border-bottom-right-radius: 20rpx;
				box-shadow: 10rpx 10rpx 5rpx #888888;
				flex-direction: row;
				.image{
					position: absolute;
					right:70rpx;
				}
			}
		}
	}
	
</style>
